package ink.xiaobaibai.serviceOxy.onePay.impl;

import ink.xiaobaibai.bo.DeviceMqttBo;
import ink.xiaobaibai.serviceOxy.IMqttService;
import ink.xiaobaibai.serviceOxy.onePay.IDeviceOxygenControlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author: 小白白
 * @create: 2021-05-28
 **/

@Service
public class DeviceOxygenControlServiceImpl implements IDeviceOxygenControlService {

    @Autowired
    private IMqttService mqttService;

    @Override
    public boolean openOxygenDevice(DeviceMqttBo deviceMqttBo) {
        //发送开启消息
        this.mqttService.openDevice(deviceMqttBo.getDeviceCode(), deviceMqttBo);
        return true;
    }

    @Override
    public boolean closeOxygenDevice(String deviceCode, String msg) {
        //发送关闭消息
        this.mqttService.closeDevice(deviceCode);
        return true;
    }

}
